#ifndef _CHANNEL_H_
#define _CHANNEL_H_
#ifdef __cplusplus
extern "C" {
#endif
/* Constants */
#define CHANNEL_NAME_LEN	42

/* Channel struct */
typedef struct {
	/* Title ID */
	u64  tid;

	/* Channel name */
	char name[CHANNEL_NAME_LEN];
} ATTRIBUTE_PACKED channel;

extern channel *channel_list;
extern  u32 channel_cnt;
extern u32  str_maxlen;
extern s32  start , selected;

/* IMET struct */
typedef struct {
	/* Channel identifier/creator */
	u8 identifier[0x20];
	u8 fill1[0x10];
	u8 creator[0x10];

	u8 zeroes[0x40];

	/* IMET string */
	u32 imet;
	u64 padding;

	/* Banner sizes */
	u32 sizes[3];
	u32 fill2;

	/* Channel names */
	u16 name_jp[CHANNEL_NAME_LEN];
	u16 name_en[CHANNEL_NAME_LEN];
	u16 name_de[CHANNEL_NAME_LEN];
	u16 name_fr[CHANNEL_NAME_LEN];
	u16 name_es[CHANNEL_NAME_LEN];
	u16 name_it[CHANNEL_NAME_LEN];
	u16 name_nl[CHANNEL_NAME_LEN];

	u8  fill3[0x348];

	/* MD5 Crypto */
	u8 crypto[0x10];
} ATTRIBUTE_PACKED imet;



/* Prototypes */
int Channel_Launch(void);
void Channel_MoveList(s8);
void Channel_PrintList(void);
s32  Channel_GetList(void);


#ifdef __cplusplus
}
#endif
#endif
